<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body bgcolor="#0000cc">
    <form id="form1" runat="server">
<div id="headerDiv">
 This is the header
</div>
<div id="contentDiv">
<iframe id="PDFFrame" runat="server" 
            style="width:100%; height:100%; margin-right: 0px;" 
        src="PDFDisplay.aspx"></iframe>
</div>
<div id="buttonAndFooterDiv">
 <div align="center">
  <asp:Button ID="Button1" runat="server" Text="Button" />
 </div>
 <div align="center">
  This is the footer
 </div>
</div>
    

    

    </form>
    <script type='text/javascript'>
<!--
        getWindowHeight = function () {
            var functionReturn = 0;

            if ((document.documentElement) && (document.documentElement.clientHeight))
                functionReturn = document.documentElement.clientHeight;
            else if ((document.body) && (document.body.clientHeight))
                functionReturn = document.body.clientHeight;
            else if ((document.body) && (document.body.offsetHeight))
                functionReturn = document.body.offsetHeight;
            else if (window.innerHeight)
                functionReturn = window.innerHeight - 18;

            functionReturn = parseInt(functionReturn);
            if ((isNaN(functionReturn) == true) || (functionReturn < 0))
                functionReturn = 0;

            return functionReturn;
        };
        getElementHeight = function (elementRef) {
            if (typeof elementRef == 'string')
                elementRef = document.getElementById(elementRef);

            var functionReturn = 0;

            if (elementRef == null)
                return 0;

            if (elementRef.offsetHeight)
                functionReturn = elementRef.offsetHeight;
            else if ((document.layers) && (elementRef.document) && (elementRef.document.height))
                functionReturn = elementRef.document.height;
            else if ((elementRef.clip) && (elementRef.clip.height))
                functionReturn = elementRef.clip.height;
            else if ((elementRef.style) && (elementRef.style.height))
                functionReturn = elementRef.style.height;
            else if ((elementRef.style) && (elementRef.style.pixelHeight))
                functionReturn = elementRef.style.pixelHeight;

            functionReturn = parseInt(functionReturn);
            if ((isNaN(functionReturn) == true) || (functionReturn < 0))
                functionReturn = 0;

            return functionReturn;
        };
        setElementHeight = function (elementRef, heightValue) {
            if (typeof elementRef == 'string')
                elementRef = document.getElementById(elementRef);

            if (elementRef == null)
                return;

            heightValue = parseInt(heightValue);
            if (isNaN(heightValue) == true)
                return;

            if ((typeof elementRef.clip != 'undefined') && (typeof elementRef.clip.height != 'undefined'))
                elementRef.clip.height = heightValue;
            else if ((typeof elementRef.style != 'undefined') && (typeof elementRef.style.height != 'undefined'))
                elementRef.style.height = heightValue + 'px';
            else if ((typeof elementRef.style != 'undefined') && (typeof elementRef.style.pixelHeight != 'undefined'))
                elementRef.style.pixelHeight = heightValue;
        };

        function lockFooterToBottomOfPage() {
            var windowHeight = getWindowHeight();

            var divHeights = getElementHeight('headerDiv');
            divHeights += getElementHeight('buttonAndFooterDiv');

            var contentHeight = getElementHeight('contentDiv');
            var newContentHeight = windowHeight - divHeights;

            if (contentHeight < newContentHeight)
                setElementHeight('contentDiv', newContentHeight);

            if (document.getElementById('buttonAndFooterDiv')) {
                document.getElementById('buttonAndFooterDiv').style.position = 'absolute';
                document.getElementById('buttonAndFooterDiv').style.zIndex = '1000';
                document.getElementById('buttonAndFooterDiv').style.left = '0px';

                var topPosition = (document.body.scrollHeight > windowHeight())
   ? document.body.scrollHeight + 25 : windowHeight();
                topPosition -= getElementHeight('buttonAndFooterDiv');

                document.getElementById('buttonAndFooterDiv').style.top = topPosition + 'px';
            }
        }

        window.onload = lockFooterToBottomOfPage;
        window.onresize = lockFooterToBottomOfPage;
// -->
</script>
</body>
</html>



